/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, {Component} from 'react';
import {StyleSheet,ImageBackground, Text, View} from 'react-native';
import NavigationUtil from '../../navigator/NavigationUtil';
import {screen} from '../../public/common';
import color from '../../public/widget/color';
export default class WelcomePage extends Component {
    componentWillMount(){
        this.timer = setTimeout(()=>{
            const {navigation} = this.props;
            NavigationUtil.resetToHomPage({
                navigation
            })
        },1000)
    }
    componentWillUnmount(){
        this.timer && clearTimeout(this.timer)
    }
    render() {
        return (
            <ImageBackground style={styles.backgroundImg} source={require('../../images/loginbg.jpg')}>
                <View style={styles.container}>
                    <Text style={styles.welcome}>WELCOME</Text>
                </View>
            </ImageBackground>
        );
    }
}
const styles = StyleSheet.create({
    backgroundImg:{
        flex:1,
        backgroundColor:'#fff',
    },
    container: {
        justifyContent: 'center',
        alignItems: 'center',
        width:screen.width,
        height:screen.height
    },
    welcome: {
        fontSize: 20,
        textAlign: 'center',
        margin: 10,
        color:color.themeColor,
    },
});
